import Foundation

struct FoodDetailModel {
    let food: FoodItemModel
    let otherFoods: [FoodItemModel]
    let storeInfo: FoodStoreItemModel
    
    init(food: FoodItemModel, otherFoods: [FoodItemModel], storeInfo: FoodStoreItemModel) {
        self.food = food
        self.otherFoods = otherFoods
        self.storeInfo = storeInfo
    }
    
    init(resp: FoodDetailRespModel) {
        self.food = FoodItemModel(respModel: resp.goods)
        self.otherFoods = resp.goodsListNot.map({ FoodItemModel(respModel: $0) })
        self.storeInfo = FoodStoreItemModel(respModel: resp.merchant)
    }
}

struct FoodDetailDataRespModel: Codable {
    let data: FoodDetailRespModel
}

struct FoodDetailRespModel: Codable {
    let goodsListNot: [FoodItemRespModel]
    let goods: FoodItemRespModel
    let merchant: FoodStoreItemRespModel
}

